gtkplacesview: don't fetch networks if local only
authorCarlos Soriano <csoriano@gnome.org>
Sat, 29 Aug 2015 19:16:34 +0000 (21:16 +0200)
committerCarlos Soriano <csoriano@gnome.org>
Sun, 30 Aug 2015 07:47:28 +0000 (09:47 +0200)
We were fetching networks even on local only mode.
Avoid to do extra work if not necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=754150

gtk/gtkplacesview.c

index a508fceded9dd7ed3d48deae9d895de662c26679..60ac2849530783a507715521ae400270a0581825 100644 (file)
@@ -1132,7 +1132,8 @@ update_places (GtkPlacesView *view)
   populate_servers (view);
 
   /* fetch networks and add them asynchronously */
-  fetch_networks (view);
+  if (!gtk_places_view_get_local_only (view))
+    fetch_networks (view);
 
   update_view_mode (view);
 }
@@ -2479,7 +2480,7 @@ gtk_places_view_set_local_only (GtkPlacesView *view,
       priv->local_only = local_only;
 
       gtk_widget_set_visible (priv->actionbar, !local_only);
-      gtk_list_box_invalidate_filter (GTK_LIST_BOX (priv->listbox));
+      update_places (view);
 
       update_view_mode (view);